﻿using System.Collections.Generic;
using System.Linq;
using TestOnlineProject.Models.DataAccess;
using TestOnlineProject.Models.Entities;

namespace TestOnlineProject.Models.BusinessLogic
{
    public class RoleBLO
    {
        RoleDAO roleDAO = new RoleDAO();

        /// <summary>
        /// Select role list.
        /// </summary>
        /// <returns>Role list</returns>

        public List<Role> ToList()
        {
            // Select role list.
            var roles = roleDAO.Select().Where(x => x.RoleId != 1).OrderByDescending(x => x.RoleId).ToList();
            return roles;
        }
    }
}